package com.yu.mall.util;

import com.yu.mall.constants.Constants;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Slf4j
public class LogUtil {

    private final static Logger logger = LoggerFactory.getLogger(LogUtil.class);

    public static String formatLog(String before,String after){
        String str = "";
        str += Constants.LOG_LEFT_SYMBOL + before + Constants.LOG_RIGHT_SYMBOL;
        str += Constants.LOG_LEFT_SYMBOL + after + Constants.LOG_RIGHT_SYMBOL;
        return str;
    }

    public static void info(String s){
        logger.info(s);
    }

    public static void debug (String s){
        logger.debug(s);
    }

    public static void error (String s){
        logger.error(s);
    }

    public static void error (String s,Exception e){
        logger.error(s,e);
    }
}
